package android.game;

import java.util.List;



import framework.Input.TouchEvent;

import framework.Game;
import framework.Graphics;
import framework.Screen;

public class HelpScreen extends Screen{
	private int alpha=96;
	public HelpScreen(Game game) {
		super(game);
	}
	@Override
	public void update(float deltaTime) {
        List<TouchEvent> touchEvents = game.getInput().getTouchEvents();
        game.getInput().getKeyEvents();
		int len = touchEvents.size();
		for(int i = 0; i < len; i++){
			 TouchEvent event = touchEvents.get(i);
	            if(event.type == TouchEvent.TOUCH_UP) {
	                if(event.x > 256 && event.y > 416 ) {
	                    game.setScreen(new MainMenuScreen(game));
	                    if(Settings.soundEnabled)
	                        Assets.menuClick.play(1);
	                    return;
	                }
	            }
		}
	}

	@Override
	public void present(float deltaTime) {
		Graphics g = game.getGraphics();
		g.drawPixmap(Assets.background, 0, 0);
		//g.drawPixmap(Assets.help, 0, 0);
		if(alpha<255)
			alpha+=3;
		g.drawPixmapAlpha(Assets.help, 0, 0, alpha);
		g.drawPixmap(Assets.back, 246, 406);
		
		
	}

	@Override
	public void pause() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void resume() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void dispose() {
		// TODO Auto-generated method stub
		
	}

}
